<#assign sum=0><#list archives as archive><#if archive.count??><#assign sum=sum +archive.count></#if></#list>
<#include "/default/utils/ui.ftl"/>
<link href="${base}/site/css/archive.css" rel="stylesheet"/>
<section class="focusbox">
    <div class="container">
        <h1 class="focusbox-title">文章归档</h1>
        <div class="focusbox-text">这里是文章归档！</div>
    </div>
</section>
<@layout "文章归档">
<div class="row">
    <div class="content">
        <div class="container space30">
            <div class="row">
                <!--feature start-->
                <div class="col-xs-12 col-md-9 side-left wow fadeInUp animated"
                     style="visibility: visible; animation-name: fadeInUp;">
                    <article class="post" itemscope="" itemtype="http://schema.org/BlogPosting">
                        <div class="post-header">
                            <h3 class="post-title">坦率的讲 - 本站目前共计${sum}篇文章</h3>
                        </div>
                        <p>不信，你数数 ：） </p>
                        <div class="post-content markdown-body" itemprop="articleBody">
                            <div class="archives">
                                <#list archives as archive>
                                    <div class="archives-item">
                                        <h2>${archive.year}年0${archive.month}月</h2>
                                        <ul class="archives_list">
                                            <#list archive.posts as post>
                                                <li>${post.created?string("dd日HH:mm:ss")}
                                                    <a href="/post/${post.id}">${post.title}</a>
                                                </li>
                                            </#list>
                                        </ul>
                                    </div>
                                </#list>
                            </div>
                        </div>
                    </article>
                </div>

                <div class="col-xs-12 col-md-3 side-right sidebar wow fadeInUp animated"
                     style="visibility: visible; animation-name: fadeInUp;">
                    <div class="widget widget-posts">
                        <a href="#" target="_blank" rel="nofollow">
                            <img src="/storage/thumbnails/2019/0219/19164602pywv.jpg" class="full-img">
                        </a>
                    </div>

                    <div class="widget widget-posts">
                        <a href="#" target="_blank" rel="nofollow">
                            <img src="/storage/thumbnails/2019/0219/19164602pywv.jpg" class="full-img">
                        </a>
                    </div>

                </div>
                <!--feature end-->
            </div>
        </div>
    </div>

</div>
<script type="text/plain" id="chat_template">
    <li id="chat{5}">
        <a class="avt fl" target="_blank" href="${base}/users/{0}">
            <img src="{1}">
        </a>
        <div class="chat_body">
            <h5>
                <div class="fl"><a class="chat_name" href="${base}/users/{0}">{2}</a><span>{3}</span></div>
                <div class="fr reply_this"><a href="javascript:void(0);" onclick="goto('{5}', '{2}')">[回复]</a></div>
                <div class="clear"></div>
            </h5>
            <div class="chat_p">
                <div class="chat_pct">{4}</div> {6}
            </div>
        </div>
        <div class="clear"></div>
        <div class="chat_reply"></div>
    </li>


</script>
<script type="text/javascript">
    function goto(pid, user) {
        document.getElementById('chat_text').scrollIntoView();
        $('#chat_text').focus();
        $('#chat_text').val('');
        $('#chat_to').text(user);
        $('#chat_pid').val(pid);

        $('#chat_reply').show();
    }

    var container = $("#chat_container");
    var template = $('#chat_template')[0].text;

    seajs.use(['comment', 'view'], function (comment) {
        comment.init({
            load: '${site.controls.comment}',
            load_url: '${base}/comment/leave/history',
            post_url: '${base}/comment/submit',
            toId: '${view.id}',
            onLoad: function (i, data) {
                var content = data.content;
                var quoto = '';
                if (data.pid > 0 && !(data.parent === null)) {
                    var pat = data.parent;
                    var pcontent = pat.content;
                    quoto = '<div class="quote"><a href="${base}/users/' + pat.author.id + '">@' + pat.author.name + '</a>: ' + pcontent + '</div>';
                }
                var item = jQuery.format(template,
                        data.author.id,
                        data.author.avatar,
                        data.author.name,
                        data.created,
                        content,
                        data.id, quoto);
                return item;
            }
        });
    });

</script>
</@layout>